import React from 'react'

// 引入路由文件
import {
  BrowserRouter as Router,
  Link,
  Route,
  Redirect
} from 'react-router-dom'
//引入路由
import Home from './pages/home/index'
import Maps from './pages/maps/index'
import Search from './pages/search/index'
import Citylist from './pages/citylist/index'

function App() {
  return (
    <Router>
      <div className="App">
        {/* // 重定向到首页 home 页面 */}
        <Route
          path="/"
          exact
          render={() => <Redirect to="/home"></Redirect>}
        ></Route>

        <Route path="/home" component={Home}></Route>
        <Route path="/maps" component={Maps}></Route>
        <Route path="/search" component={Search}></Route>
        <Route path="/citylist" component={Citylist}></Route>
      </div>
    </Router>
  )
}

export default App
